package com.example.helloandroidworld;

import com.actionbarsherlock.app.SherlockFragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;


public class Messaging extends SherlockFragment
{
	Button Now, Reminder, ViewReminders;
	
	@Override
	public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState )
	{ 
		// inflate the view and assign to variable view
		View view = inflater.inflate( R.layout.messaging,  container, false);
		setUpButtons(view);
		return view;
	}
	
	private void setUpButtons(View view)
	{
		
		Now = (Button) view.findViewById(R.id.buttonNow);
		Reminder = (Button) view.findViewById(R.id.buttonReminder);
		ViewReminders = (Button) view.findViewById(R.id.buttonViewReminders);

		Now.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {// transitions screens
				startActivity( new Intent(getActivity(), MessagingSMS.class)); }});
		
		Reminder.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) { // transitions screens
				startActivity( new Intent(getActivity(), MessagingReminder.class)); }});
		
		ViewReminders.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				startActivity( new Intent(getActivity(), MessagingViewReminders.class)); }});
	}
	@Override
	public void onCreate( Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
	}
}